#!/usr/bin/python

import sys 

for eachLine in sys.stdin:
    eachLine = eachLine.strip()
    if(eachLine.find("\t") != -1 and len(eachLine.split("\t")) >= 2):
        word = eachLine.split("\t")[0]
        for eachArt in eachLine.split("\t")[1:]:
            if(word != "" and eachArt.strip()!=""):
                result =  word+"\t"+eachArt.strip()
                try:
                    print result
                except:
                    continue

